package chai.ning.multition;

/**
 * 1、將所有構造私有化
 * 2、創建當前類的有限個實例
 * 3、提供一個類方法用來獲取該類的實例
 */
public class Season {

	private static final Season SPRING = new Season("春節","春暖花開");
	private static final Season SUMMER = new Season( "夏季" , "春暖花開0" );
			
	
	private String name;
	private String feature;
	
	private Season(String name , String feature) {
		this.name = name;
		this.feature = feature;
	}
	public static Season getInstance( int index ) {
		switch(index){
			case 1: return SPRING;
			case 2: return SUMMER;
			default : return null;
		}
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getFeature() {
		return feature;
	}
	public void setFeature(String feature) {
		this.feature = feature;
	}
	
	
}
